﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CodeCamp.Models.Volunteers.VolunteerListViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Html.Encode( Model.EventDisplayName ) %> | Volunteer Opportunities
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Volunteer Opportunities</h2>
    <p>
      <strong>We need your help.</strong>
      Portland Code Camp is a community event of, by, and for the software development community.
      It takes a lot of volunteers to keep this event free and open to the public.
      Please show your support for the Portland Code Camp and the community by donating
      a few hours of time to make this be a successful, outstanding event.
    </p>
    <p>
      <strong>Thank You Reception.</strong>
      Volunteers will be invited to an exclusive reception for our volunteers,
      presenters and special guests on Friday evening, May 21, 2010.
      It is our way of saying "Thank You!" to our supporters.
      And it's a great time for you to connect and network with people who are taking an active part in Portland Code Camp. 
    </p>

    <table width="100%">
      <tr>
        <th style="width: 40%; border: 0; text-align: left;">Task</th>
        <th style="width: 60%; border: 0; text-align: left;">Volunteer for this task</th>
      </tr>
      <% foreach ( var task in Model.Tasks )
         { %>
            <tr>
              <td style="border-width: 1px 0 0 0;">
                <p><%= Html.Encode( task.Name ) %></p>
                <% if ( !string.IsNullOrEmpty( task.Notes ) )
                   { %>
                    <p><i><%= Html.Encode( task.Notes )%></i></p>
                <% } %>
              </td>
              <td style="border-width: 1px 0 0 0;">
                <p>Click on a time to volunteer
                </p>
                <ul>
                  <% foreach ( var time in task.Times )
                     {
                      string subject = "Volunteering for Portland Code Camp 2010 and Portland SQL Saturday 2010";
                      string body = string.Format(
                        "I want to volunteer at Portland Code Camp 2010 and Portland SQL Saturday 2010 on {0} for {1} from {2} to {3} at the University of Portland (unless otherwise noted).%0A%0AMy contact phone is: -- please fill in --%0A%0APlease sign me up!",
                        time.Date.ToShortDateString(),
                        task.Name,
                        CodeCamp.Views.Volunteers.DateTimeFormatter.ToShortTimeString( time.StartTime ),
                        CodeCamp.Views.Volunteers.DateTimeFormatter.ToShortTimeString( time.EndTime ) );
                      string url = string.Format( "mailto:volunteers@portlandcodecamp.org?subject={0}&body={1}", subject, body );
                      string timeRange = string.Format( "{0} to {1}", 
                        CodeCamp.Views.Volunteers.DateTimeFormatter.ToShortTimeString( time.StartTime ), 
                        CodeCamp.Views.Volunteers.DateTimeFormatter.ToShortTimeString( time.EndTime ) );
                  %>
                      <li>
                        <% if ( time.VolunteersStillNeeded > 0 )
                           { %>
                              <a href="<%= Html.Encode( url ) %>"><%= Html.Encode( timeRange )%>, 
                              <%= Html.Encode( time.Date.ToString("m", System.Globalization.CultureInfo.CreateSpecificCulture("en-us") ) ) %></a>,
                              <%= Html.Encode( time.VolunteersStillNeeded ) %> more volunteer(s) needed
                        <% }
                           else
                           { %>
                              <%= Html.Encode( timeRange )%>, this time has enough volunteers
                        <% } %>
                      </li>
                  <% } %>
                </ul>
              </td>
            </tr>
      <% }  %>
    </table>

</asp:Content>
